//package com.huangbc.apipassenger.controller;
//
//import com.huangbc.apipassenger.request.CheckVerificationCodeDTO;
//import com.huangbc.apipassenger.request.SendVerificationCodeDTO;
//import com.huangbc.apipassenger.service.VerificationCodeService;
//import com.huangbc.internalcommon.dto.ResponseResult;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * @Author: Derek.huang on 2024/3/27 17:46.
// */
//@RestController
//public class VerificationCodeController {
//
//    @Autowired
//    private VerificationCodeService verificationCodeService;
//
//    /**
//     * 生成验证码
//     * @param verificationCodeDTO
//     * @return
//     */
//    @PostMapping("/verification-code")
//    public ResponseResult verificationCode(@RequestBody @Validated SendVerificationCodeDTO verificationCodeDTO){
//        //        int i = 1/0;
//        String passengerPhone = verificationCodeDTO.getPassengerPhone();
//        System.out.println("接受到的手机号参数："+passengerPhone);
//        return verificationCodeService.generatorCode(passengerPhone);
//
//    }
//
//    /**
//     * 校验验证码
//     * @param verificationCodeDTO
//     * @return
//     */
//    @PostMapping("/verification-code-check")
//    public ResponseResult checkVerificationCode(@Validated @RequestBody CheckVerificationCodeDTO verificationCodeDTO){
//
//        String passengerPhone = verificationCodeDTO.getPassengerPhone();
//        String verificationCode = verificationCodeDTO.getVerificationCode();
//
//        System.out.println("手机号："+passengerPhone+",验证码:"+verificationCode);
//
//        return verificationCodeService.checkCode(passengerPhone, verificationCode);
//    }
//}
//
